<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%@ include file="/commons/include/list_page.inc"%>
<script type="text/javascript"
	src="<s:url value="/script/easyajax.js"/>"></script>
		<script type="text/javascript"
			src="<s:url value="/script/sysOper.js"/>"></script>
		<script type="text/javascript"
			src="<s:url value="/components/datepicker/WdatePicker.js"/>"></script>
		
		
		
	<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">

			<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="100%">
				<tr height="100%">
					<td background="" class="leftbg" valign="top">
						<table width="100%" height="100%" border="0" cellspacing="0"
							cellpadding="0" align="center" bgcolor="#FFFFFF">
							<tr>
								<td valign="top" align="center">
									<br>

									<table width="98%" border="0" align="center" cellspacing="0"
										cellpadding="0"
										background="<s:url value="/images/catalog_manage_8b_1.gif"/>">
										<tr>
											<td>
												<img src="<s:url value="/images/catalog_manage_8.gif"/>"
													width=100% height=11 alt="">
											</td>
										</tr>
										<tr>
											<td align="center">
		<table width="98%" id="singleProductTable" border="0" cellspacing="0" cellpadding="7"
			align="center" class=tablecolor2>
													<tr>
														<td bgcolor="9AC2EB" width="20%">
															<div align="center">
																<font color="#FFFFFF">所属产品</font>
															</div>
														</td>
														<td bgcolor="9AC2EB" width="*">
															<div align="center">
																<font color="#FFFFFF">负责人名称</font>
															</div>
														</td>
														<td bgcolor="9AC2EB" width="10%">
															<div align="center">
																<font color="#FFFFFF">是否主要负责人</font>
															</div>
														</td>
														<td bgcolor="9AC2EB" width="10%">
															<div align="center">
																<font color="#FFFFFF">操作</font>
															</div>
														</td>
													</tr>
													<s:iterator value="productManagers">
														<tr>
															<td>
																<div align="center">
																	<a href="su_showProduct.action?product.id=${product.id}"><s:property value="product.name" /></a>
																</div>
															</td>
															<td>
																<div align="center">
																	<s:property value="person.name" />
																</div>
															</td>
															<td>
																<div align="center">
																	<s:if test="isPrimary==1">是</s:if>
																	<s:else>否</s:else>
																</div>
															</td>
															<td>
																	<a href="su_showProduct.action?product.id=${product.id}">编辑</a>
																	<a href="javascript:void(0);" onclick="deleteProduct(${product.id});">删除</a>
															</td>
														</tr>
													</s:iterator>
												</table>

											</td>
										</tr>
										<tr>
											<td>
												<img src="<s:url value="/images/catalog_manage_8a.gif"/>"
													width="100%" height="9">
											</td>
										</tr>
									</table>


	</body>
<script>
function deleteProduct(productId){
	var ind=event.srcElement.parentElement.parentElement.rowIndex;
	if(!confirm('您正在删除产品目录下产品信息，是否确认删除?')){
		return;
	}
	var url="<s:url value="/business/product/su_delProduct.action?product.id=" />"+productId;
	callSynchronized(url,function(XML){//同步调用
	    var ajax=new AjaxObj();
	    if($$(XML.responseXML,"str")=="true"){
	        singleProductTable.deleteRow(ind);
	    	alert("删除成功!");
	    }else{
	    	alert("删除失败!");
	    }
	});
}
function editProduct(producId){
    form2.action="<s:url value="/business/product/su_editProduct.action" />?product.id="+producId;
	form2.submit();
}

</script>
</html>
